//
//  CZWelcomeVC.m
//  XinLang_OC
//
//  Created by WONG on 16/2/22.
//  Copyright © 2016年 cheuhui. All rights reserved.
//

#import "CZWelcomeVC.h"
#import "AppDelegate.h"
#import "CZUserAccount.h"


@interface CZWelcomeVC ()

@end

@implementation CZWelcomeVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    CZUserAccount *userAccount = [CZUserAccount loadUserAccount];
//    CZUserAccount *userAccount = [CZUserAccount new];
    [userAccount loadUserInfo];
    
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 180, 180)];
    imageView.backgroundColor = [UIColor orangeColor];
    [imageView sd_setImageWithURL:[NSURL URLWithString:userAccount.avatar_large] placeholderImage:[UIImage imageNamed:@"avatar_default_big"]];
    [self.view addSubview:imageView];
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(100, 300, 200, 50)];
    label.text = userAccount.screen_name;
    
    [self.view addSubview:label];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [AppDelegate switchRootViewController:YES];
    });
    
    
}



@end
